<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>理论+实战 构建完整JVM知识体系 | 小鹏杂谈</title>
    <meta name="generator" content="VuePress 1.8.2">
    <link rel="icon" href="/favicon.ico">
    <meta name="description" content="小鹏杂谈">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
    
    <link rel="preload" href="/assets/css/0.styles.8516fda1.css" as="style"><link rel="preload" href="/assets/js/app.b9ccfc55.js" as="script"><link rel="preload" href="/assets/js/4.8390fbcb.js" as="script"><link rel="preload" href="/assets/js/1.3334f995.js" as="script"><link rel="preload" href="/assets/js/23.d3455a59.js" as="script"><link rel="prefetch" href="/assets/js/10.8eb4e356.js"><link rel="prefetch" href="/assets/js/11.31befa4c.js"><link rel="prefetch" href="/assets/js/12.da37eb75.js"><link rel="prefetch" href="/assets/js/13.b24ba73c.js"><link rel="prefetch" href="/assets/js/14.3bbed283.js"><link rel="prefetch" href="/assets/js/15.fac60f8d.js"><link rel="prefetch" href="/assets/js/16.b75d2036.js"><link rel="prefetch" href="/assets/js/17.116317c5.js"><link rel="prefetch" href="/assets/js/18.80fdbeda.js"><link rel="prefetch" href="/assets/js/19.459fc46f.js"><link rel="prefetch" href="/assets/js/20.452f30f9.js"><link rel="prefetch" href="/assets/js/21.99f641dc.js"><link rel="prefetch" href="/assets/js/22.081dc33b.js"><link rel="prefetch" href="/assets/js/24.8f5d39e0.js"><link rel="prefetch" href="/assets/js/25.c3dc47fb.js"><link rel="prefetch" href="/assets/js/26.d93b5cf2.js"><link rel="prefetch" href="/assets/js/27.6d2089a5.js"><link rel="prefetch" href="/assets/js/28.57336847.js"><link rel="prefetch" href="/assets/js/29.903b5e06.js"><link rel="prefetch" href="/assets/js/3.32100170.js"><link rel="prefetch" href="/assets/js/30.274666a3.js"><link rel="prefetch" href="/assets/js/31.fa9bd0f8.js"><link rel="prefetch" href="/assets/js/32.20179720.js"><link rel="prefetch" href="/assets/js/33.2dcc611d.js"><link rel="prefetch" href="/assets/js/34.ba79122c.js"><link rel="prefetch" href="/assets/js/35.bcd9298f.js"><link rel="prefetch" href="/assets/js/36.bf6245d9.js"><link rel="prefetch" href="/assets/js/37.734eb893.js"><link rel="prefetch" href="/assets/js/38.26999070.js"><link rel="prefetch" href="/assets/js/39.cc1f016d.js"><link rel="prefetch" href="/assets/js/40.da84c263.js"><link rel="prefetch" href="/assets/js/41.a96b8efa.js"><link rel="prefetch" href="/assets/js/42.d586cccb.js"><link rel="prefetch" href="/assets/js/43.69bb61aa.js"><link rel="prefetch" href="/assets/js/44.3be5a840.js"><link rel="prefetch" href="/assets/js/45.208a3bc3.js"><link rel="prefetch" href="/assets/js/46.2d6cacad.js"><link rel="prefetch" href="/assets/js/47.5add378a.js"><link rel="prefetch" href="/assets/js/48.587139cc.js"><link rel="prefetch" href="/assets/js/49.57f7c25a.js"><link rel="prefetch" href="/assets/js/5.ff1e84d1.js"><link rel="prefetch" href="/assets/js/50.efde6e4a.js"><link rel="prefetch" href="/assets/js/51.c9447e5f.js"><link rel="prefetch" href="/assets/js/52.57a51c35.js"><link rel="prefetch" href="/assets/js/53.4be0f240.js"><link rel="prefetch" href="/assets/js/54.8dabd349.js"><link rel="prefetch" href="/assets/js/55.3b8ae0e4.js"><link rel="prefetch" href="/assets/js/56.07e830b2.js"><link rel="prefetch" href="/assets/js/57.8c0dbdcc.js"><link rel="prefetch" href="/assets/js/58.63387df6.js"><link rel="prefetch" href="/assets/js/59.959bb8c8.js"><link rel="prefetch" href="/assets/js/6.56a2b5cd.js"><link rel="prefetch" href="/assets/js/60.1041d86f.js"><link rel="prefetch" href="/assets/js/61.f58e6c18.js"><link rel="prefetch" href="/assets/js/62.a1a460c7.js"><link rel="prefetch" href="/assets/js/63.6c611c7d.js"><link rel="prefetch" href="/assets/js/64.6711119c.js"><link rel="prefetch" href="/assets/js/65.4655c3b1.js"><link rel="prefetch" href="/assets/js/66.e5dfe864.js"><link rel="prefetch" href="/assets/js/67.37515de0.js"><link rel="prefetch" href="/assets/js/68.0c8ba92d.js"><link rel="prefetch" href="/assets/js/69.52121d38.js"><link rel="prefetch" href="/assets/js/7.6f143d9f.js"><link rel="prefetch" href="/assets/js/70.1ab4d6a1.js"><link rel="prefetch" href="/assets/js/71.dc99dd1d.js"><link rel="prefetch" href="/assets/js/72.02e21e52.js"><link rel="prefetch" href="/assets/js/73.21efc121.js"><link rel="prefetch" href="/assets/js/74.649f4e1d.js"><link rel="prefetch" href="/assets/js/75.331c13e7.js"><link rel="prefetch" href="/assets/js/76.a94b5ff0.js"><link rel="prefetch" href="/assets/js/8.d4d40f2a.js"><link rel="prefetch" href="/assets/js/9.1b8824e7.js">
    <link rel="stylesheet" href="/assets/css/0.styles.8516fda1.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container no-sidebar" data-v-1156296a><div data-v-1156296a><div id="loader-wrapper" class="loading-wrapper" data-v-d48f4d20 data-v-1156296a data-v-1156296a><div class="loader-main" data-v-d48f4d20><div data-v-d48f4d20></div><div data-v-d48f4d20></div><div data-v-d48f4d20></div><div data-v-d48f4d20></div></div> <!----> <!----></div> <div class="password-shadow password-wrapper-out" style="display:none;" data-v-4e82dffc data-v-1156296a data-v-1156296a><h3 class="title" data-v-4e82dffc data-v-4e82dffc>小鹏杂谈</h3> <p class="description" data-v-4e82dffc data-v-4e82dffc>小鹏杂谈</p> <label id="box" class="inputBox" data-v-4e82dffc data-v-4e82dffc><input type="password" value="" data-v-4e82dffc> <span data-v-4e82dffc>Konck! Knock!</span> <button data-v-4e82dffc>OK</button></label> <div class="footer" data-v-4e82dffc data-v-4e82dffc><span data-v-4e82dffc><i class="iconfont reco-theme" data-v-4e82dffc></i> <a target="blank" href="https://vuepress-theme-reco.recoluan.com" data-v-4e82dffc>vuePress-theme-reco</a></span> <span data-v-4e82dffc><i class="iconfont reco-copyright" data-v-4e82dffc></i> <a data-v-4e82dffc><span data-v-4e82dffc>lzpeng723</span>
            
          <span data-v-4e82dffc>2021 - </span>
          2022
        </a></span></div></div> <div class="hide" data-v-1156296a><header class="navbar" data-v-1156296a><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><img src="/logo.png" alt="小鹏杂谈" class="logo"> <span class="site-name">小鹏杂谈</span></a> <div class="links"><div class="color-picker"><a class="color-button"><i class="iconfont reco-color"></i></a> <div class="color-picker-menu" style="display:none;"><div class="mode-options"><h4 class="title">Choose mode</h4> <ul class="color-mode-options"><li class="dark">dark</li><li class="auto active">auto</li><li class="light">light</li></ul></div></div></div> <div class="search-box"><i class="iconfont reco-search"></i> <input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/" class="nav-link"><i class="iconfont reco-home"></i>
  首页
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-category"></i>
      分类
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/categories/运维/" class="nav-link"><i class="undefined"></i>
  运维
</a></li><li class="dropdown-item"><!----> <a href="/categories/开发/" class="nav-link"><i class="undefined"></i>
  开发
</a></li><li class="dropdown-item"><!----> <a href="/categories/后端/" class="nav-link"><i class="undefined"></i>
  后端
</a></li><li class="dropdown-item"><!----> <a href="/categories/前端/" class="nav-link"><i class="undefined"></i>
  前端
</a></li><li class="dropdown-item"><!----> <a href="/categories/软件/" class="nav-link"><i class="undefined"></i>
  软件
</a></li><li class="dropdown-item"><!----> <a href="/categories/文档/" class="nav-link"><i class="undefined"></i>
  文档
</a></li><li class="dropdown-item"><!----> <a href="/categories/数据库/" class="nav-link"><i class="undefined"></i>
  数据库
</a></li><li class="dropdown-item"><!----> <a href="/categories/Node.js/" class="nav-link"><i class="undefined"></i>
  Node.js
</a></li><li class="dropdown-item"><!----> <a href="/categories/游戏/" class="nav-link"><i class="undefined"></i>
  游戏
</a></li></ul></div></div><div class="nav-item"><a href="/tag/" class="nav-link"><i class="iconfont reco-tag"></i>
  标签
</a></div><div class="nav-item"><a href="/timeline/" class="nav-link"><i class="iconfont reco-date"></i>
  时间线
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-message"></i>
      文档
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/docs/minimal-boot/" class="nav-link"><i class="undefined"></i>
  minimal-boot
</a></li><li class="dropdown-item"><!----> <a href="/docs/minimal-cloud/" class="nav-link"><i class="undefined"></i>
  minimal-cloud
</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-message"></i>
      联系方式
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="https://github.com/lzpeng723" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-github"></i>
  GitHub
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><!----> <a href="https://gitee.com/lzpeng723" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-mayun"></i>
  Gitee
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><!----> <a href="https://www.zhihu.com/people/lzpeng723" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-zhihu"></i>
  知乎
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></div></div> <!----></nav></div></header> <div class="sidebar-mask" data-v-1156296a></div> <aside class="sidebar" data-v-1156296a><div class="personal-info-wrapper" data-v-828910c6 data-v-1156296a><img src="/avatar.jpg" alt="author-avatar" class="personal-img" data-v-828910c6> <h3 class="name" data-v-828910c6>
    lzpeng723
  </h3> <div class="num" data-v-828910c6><div data-v-828910c6><h3 data-v-828910c6>66</h3> <h6 data-v-828910c6>Articles</h6></div> <div data-v-828910c6><h3 data-v-828910c6>19</h3> <h6 data-v-828910c6>Tags</h6></div></div> <ul class="social-links" data-v-828910c6></ul> <hr data-v-828910c6></div> <nav class="nav-links"><div class="nav-item"><a href="/" class="nav-link"><i class="iconfont reco-home"></i>
  首页
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-category"></i>
      分类
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/categories/运维/" class="nav-link"><i class="undefined"></i>
  运维
</a></li><li class="dropdown-item"><!----> <a href="/categories/开发/" class="nav-link"><i class="undefined"></i>
  开发
</a></li><li class="dropdown-item"><!----> <a href="/categories/后端/" class="nav-link"><i class="undefined"></i>
  后端
</a></li><li class="dropdown-item"><!----> <a href="/categories/前端/" class="nav-link"><i class="undefined"></i>
  前端
</a></li><li class="dropdown-item"><!----> <a href="/categories/软件/" class="nav-link"><i class="undefined"></i>
  软件
</a></li><li class="dropdown-item"><!----> <a href="/categories/文档/" class="nav-link"><i class="undefined"></i>
  文档
</a></li><li class="dropdown-item"><!----> <a href="/categories/数据库/" class="nav-link"><i class="undefined"></i>
  数据库
</a></li><li class="dropdown-item"><!----> <a href="/categories/Node.js/" class="nav-link"><i class="undefined"></i>
  Node.js
</a></li><li class="dropdown-item"><!----> <a href="/categories/游戏/" class="nav-link"><i class="undefined"></i>
  游戏
</a></li></ul></div></div><div class="nav-item"><a href="/tag/" class="nav-link"><i class="iconfont reco-tag"></i>
  标签
</a></div><div class="nav-item"><a href="/timeline/" class="nav-link"><i class="iconfont reco-date"></i>
  时间线
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-message"></i>
      文档
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/docs/minimal-boot/" class="nav-link"><i class="undefined"></i>
  minimal-boot
</a></li><li class="dropdown-item"><!----> <a href="/docs/minimal-cloud/" class="nav-link"><i class="undefined"></i>
  minimal-cloud
</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-message"></i>
      联系方式
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="https://github.com/lzpeng723" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-github"></i>
  GitHub
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><!----> <a href="https://gitee.com/lzpeng723" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-mayun"></i>
  Gitee
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><!----> <a href="https://www.zhihu.com/people/lzpeng723" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-zhihu"></i>
  知乎
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></div></div> <!----></nav> <!----> </aside> <div class="password-shadow password-wrapper-in" style="display:none;" data-v-4e82dffc data-v-1156296a><h3 class="title" data-v-4e82dffc data-v-4e82dffc>理论+实战 构建完整JVM知识体系</h3> <!----> <label id="box" class="inputBox" data-v-4e82dffc data-v-4e82dffc><input type="password" value="" data-v-4e82dffc> <span data-v-4e82dffc>Konck! Knock!</span> <button data-v-4e82dffc>OK</button></label> <div class="footer" data-v-4e82dffc data-v-4e82dffc><span data-v-4e82dffc><i class="iconfont reco-theme" data-v-4e82dffc></i> <a target="blank" href="https://vuepress-theme-reco.recoluan.com" data-v-4e82dffc>vuePress-theme-reco</a></span> <span data-v-4e82dffc><i class="iconfont reco-copyright" data-v-4e82dffc></i> <a data-v-4e82dffc><span data-v-4e82dffc>lzpeng723</span>
            
          <span data-v-4e82dffc>2021 - </span>
          2022
        </a></span></div></div> <div data-v-1156296a><main class="page"><section><div class="page-title"><h1 class="title">理论+实战 构建完整JVM知识体系</h1> <div data-v-1ff7123e><i class="iconfont reco-account" data-v-1ff7123e><span data-v-1ff7123e>lzpeng723</span></i> <i class="iconfont reco-date" data-v-1ff7123e><span data-v-1ff7123e>12/3/2021</span></i> <!----> <i class="tags iconfont reco-tag" data-v-1ff7123e><span class="tag-item" data-v-1ff7123e>Java</span></i></div></div> <div class="theme-reco-content content__default"><h1 id="理论-实战-构建完整jvm知识体系"><a href="#理论-实战-构建完整jvm知识体系" class="header-anchor">#</a> 理论+实战 构建完整JVM知识体系</h1> <h2 id="认识jvm规范"><a href="#认识jvm规范" class="header-anchor">#</a> 认识JVM规范</h2> <p>本章首先从三种认知角度带你了解JVM以及JVM的组成，帮你建立JVM知识体系，再通过阅读JVM规范来带大家掌握Class文件的格式，实现Class文件字节码的阅读，之后带大家进入ASM的开发，学会动态创建Java类。</p> <h3 id="_2-1-从三种认知角度重识jvm"><a href="#_2-1-从三种认知角度重识jvm" class="header-anchor">#</a> 2-1 从三种认知角度重识JVM</h3> <p>认识JVM: 是什么、有什么、能干什么</p> <ul><li>JVM(Java Virtual Machine), 也就是Java虚拟机;</li> <li>所谓虚拟机是指通过软件模拟的具有完整硬件系统功能的、运行在一个完全隔离环境中的计算机系统;</li> <li>JVM 是通过软件来模拟Java字节码的指令集，是Java程序的运行环境
<img src="/assets/img/img1.1d2fb090.png" alt="img1.png"></li></ul> <p>JVM 主要功能</p> <ul><li>通过 ClassLoader 寻找和装载 class 文件</li> <li>解释字节码成为指令并执行，提供class文件的运行环境</li> <li>进行运行期间的内存分配和垃圾回收</li> <li>提供与硬件交互的平台</li></ul> <p>虚拟机是Java平台无关的保障
<img src="/assets/img/img2.7eb46b7c.png" alt="img2.png"></p> <h3 id="_2-2-jvm规范作用及其核心"><a href="#_2-2-jvm规范作用及其核心" class="header-anchor">#</a> 2-2 JVM规范作用及其核心</h3> <p>理解JVM规范的作用</p> <ul><li>Java虚拟机规范为不同平台提供了一种Java技术代码的规范</li> <li>该规范使Java软件独立于平台,因为编译是针对作文虚拟机的“一般机器”而做
<img src="/assets/img/img3.9473585b.png" alt="img3.png"></li> <li>这个“一般机器”可用软件模拟并运行于各种现存的计算机系统，也可用硬件来实现</li></ul> <p>了解JVM规范里面规定的主要内容</p> <ul><li>字节码指令集(相当于中央处理器CPU)</li> <li>Class文件的格式</li> <li>数据类型和值</li> <li>运行时数据区</li> <li>栈帧</li> <li>特殊方法</li> <li>类库</li> <li>异常</li> <li>虚拟机的启动、加载、链接、和初始化</li></ul> <p><a href="https://oracle.com/technetwork/java/javase/downloads/index.html" target="_blank" rel="noopener noreferrer">Java SE 下载<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> <a href="https://docs.oracle.com/javase/specs/index.html" target="_blank" rel="noopener noreferrer">Oracle虚拟机规范官网<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <h3 id="_2-3-理解jvm规范中的虚拟机结构"><a href="#_2-3-理解jvm规范中的虚拟机结构" class="header-anchor">#</a> 2-3 理解JVM规范中的虚拟机结构</h3> <h3 id="_2-4-如何学习jvm规范中的指令集"><a href="#_2-4-如何学习jvm规范中的指令集" class="header-anchor">#</a> 2-4 如何学习JVM规范中的指令集</h3> <h3 id="_2-5-class字节码解析-理解classfile结构"><a href="#_2-5-class字节码解析-理解classfile结构" class="header-anchor">#</a> 2-5 Class字节码解析：理解ClassFile结构</h3> <h3 id="_2-6-阅读class字节码-常量池"><a href="#_2-6-阅读class字节码-常量池" class="header-anchor">#</a> 2-6 阅读Class字节码：常量池</h3> <h3 id="_2-7-阅读class字节码-类定义和属性"><a href="#_2-7-阅读class字节码-类定义和属性" class="header-anchor">#</a> 2-7 阅读Class字节码：类定义和属性</h3> <h3 id="_2-8-阅读class字节码-方法和方法调用"><a href="#_2-8-阅读class字节码-方法和方法调用" class="header-anchor">#</a> 2-8 阅读Class字节码：方法和方法调用</h3> <h3 id="_2-9-asm开发-编程模型和核心api"><a href="#_2-9-asm开发-编程模型和核心api" class="header-anchor">#</a> 2-9 ASM开发：编程模型和核心API</h3> <h3 id="_2-10-asm开发-classvisitor开发"><a href="#_2-10-asm开发-classvisitor开发" class="header-anchor">#</a> 2-10 ASM开发：ClassVisitor开发</h3> <h3 id="_2-11-asm开发-methodvisitor开发"><a href="#_2-11-asm开发-methodvisitor开发" class="header-anchor">#</a> 2-11 ASM开发：MethodVisitor开发</h3> <h3 id="_2-12-asm开发-实现模拟aop功能"><a href="#_2-12-asm开发-实现模拟aop功能" class="header-anchor">#</a> 2-12 ASM开发：实现模拟AOP功能</h3> <h2 id="类加载、连接和初始化"><a href="#类加载、连接和初始化" class="header-anchor">#</a> 类加载、连接和初始化</h2> <p>本章将带大家从类加载到JVM再到类卸载，剖析完整过程中的每个步骤的细节功能和核心技能，结合实战，重点需要大家理解类加载、类加载器，双亲委派模型，理解并掌握各种主动使用类的初始化时机等。</p> <div class="language- extra-class"><pre><code>- 3-1 类加载和类加载器 
- 3-2 案例：类加载器使用 
- 3-3 双亲委派模型 
- 3-4 案例：自定义ClassLoader 
- 3-5 双亲委派模型说明和代码示例 
- 3-6 类连接和初始化 
- 3-7 案例：类的主动初始化 
- 3-8 案例：类的初始化机制和顺序 
</code></pre></div><h2 id="内存分配"><a href="#内存分配" class="header-anchor">#</a> 内存分配</h2> <p>本章先带大家系统学习Java的内存分配模型，堆内存核心内容，内存分配相关的各种参数的配置和使用，然后带大家掌握各种内存溢出，学习如何使用MAT工具进行内存溢出的分析和问题查找。</p> <div class="language- extra-class"><pre><code>- 4-1 JVM的简化架构和运行时数据区 
- 4-2 Java堆内存模型和分配 
- 4-3 案例：Trace跟踪和Java堆的参数配置 
- 4-4 案例：新生代配置和GC日志格式 
- 4-5 案例：使用MAT进行内存分析 
- 4-6 案例：堆、栈、元空间的参数配置 
</code></pre></div><h2 id="字节码执行引擎"><a href="#字节码执行引擎" class="header-anchor">#</a> 字节码执行引擎</h2> <p>本章先带大家深入Java栈，理解栈帧、运行期操作数和局部变量表之间的交互关系，再带大家剖析方法调用，掌握静态分派和动态分派，最后通过实战带大家理解如何执行方法中的字节码指令。</p> <div class="language- extra-class"><pre><code>- 5-1 栈帧和局部变量表 
- 5-2 案例：slot是复用的 
- 5-3 案例：操作数栈 
- 5-4 静态分派和动态分派 
</code></pre></div><h2 id="垃圾回收"><a href="#垃圾回收" class="header-anchor">#</a> 垃圾回收</h2> <p>本章先来掌握垃圾回收的不可达算法、垃圾判断步骤、GC类型、引用类型等基础内容，再带大家深入垃圾回收的算法，包括标记清除法、复制算法、标记整理等，最后带大家掌握各种垃圾收集器，包括串行收集器、并行收集器、新生代Parallel Scavenge收集器、CMS、G1等。...</p> <div class="language- extra-class"><pre><code>- 6-1 垃圾回收基础和根搜索算法 
- 6-2 引用分类 
- 6-3 案例：各种引用的实现 
- 6-4 垃圾回收基础【跨代引用、记忆集、写屏障、判断垃圾的步骤、STW】 
- 6-5 垃圾回收算法 
- 6-6 垃圾收集器基础和串行收集器 
- 6-7 并行收集器和Parallel Scavenge收集器 
- 6-8 CMS收集器 
- 6-9 G1收集器 
- 6-10 ZGC收集器、GC性能指标和JVM内存配置原则 
</code></pre></div><h2 id="高效并发"><a href="#高效并发" class="header-anchor">#</a> 高效并发</h2> <p>本章先来分析Java内存模型，内存间的交互操作，然后学习多线程的可见性、有序性和指令重排、线程安全的处理方法，最后带大家学习自旋锁、锁消除、锁粗化、轻量级锁、偏向锁等锁优化。</p> <div class="language- extra-class"><pre><code>- 7-1 Java内存模型和内存间的交互操作 
- 7-2 内存间的交互操作的规则 
- 7-3 volatile特性 
- 7-4 指令重排原理和规则 
- 7-5 代码示例：指令重排的各种情况分析 
- 7-6 线程安全处理 
- 7-7 锁优化 
</code></pre></div><h2 id="性能监控与故障处理工具"><a href="#性能监控与故障处理工具" class="header-anchor">#</a> 性能监控与故障处理工具</h2> <p>本章带你掌握实际工作中的高频技能，包括jps、jinfo、jstack、jmap、jstat、jstatd、jcmd等命令行工具和jconsole、 jmc、visualvm等图形化工具，最后结合实际操作带你理解两种远程连接方式：JMX、jstatd。</p> <div class="language- extra-class"><pre><code>- 8-1 命令行工具 
- 8-2 jconsole 
- 8-3 jmc1 
- 8-4 jmc2 
- 8-5 visualVM 
- 8-6 远程连接 
- 8-7 监控实战1 
- 8-8 监控实战2 
</code></pre></div><h2 id="【实战】jvm调优"><a href="#【实战】jvm调优" class="header-anchor">#</a> 【实战】JVM调优</h2> <p>本章将从调什么、如何调、调的目标是什么三个方面带你掌握如何进行JVM调优，接着传授你JVM调优策略、调优冷思考、调优经验、如何分析和处理内存溢出，最后我们将综合应用这些知识，在给定的应用上，实战JVM调优。</p> <div class="language- extra-class"><pre><code>- 9-1 JVM调优：调什么、如何调 
- 9-2 调优的目标、调优的策略和调优冷思考 
- 9-3 JVM调优经验、内存泄漏分析 
- 9-4 实战JVM调优：认识待调优的应用 
- 9-5 实战JVM调优：录制JFR并分析结果 
- 9-6 实战JVM调优：按照分析结果调整JVM运行时内存参数 
- 9-7 实战JVM调优：查找内存泄漏点、分析并处理内存泄漏 
</code></pre></div><h2 id="面试加油站"><a href="#面试加油站" class="header-anchor">#</a> 面试加油站</h2> <p>本章以面试官视角带你剖析JVM面试问题，掌握回答技巧，轻松搞定面试中涉及到JVM相关问题，为大家的面试助力。</p> <div class="language- extra-class"><pre><code>- 10-1 字节码部分【面试精讲】 
- 10-2 内存分配【面试精讲】 
- 10-3 监控工具和实战【面试精讲】 
</code></pre></div><h2 id="课程总结"><a href="#课程总结" class="header-anchor">#</a> 课程总结</h2> <p>本章将带大家回顾总结课程重点难点，在课程问答区CC老师等着与你进一步交流，有问题欢迎大家到课程问答区提问。</p> <div class="language- extra-class"><pre><code>- 11-1 课程总结 
</code></pre></div></div></section> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">1/28/2022, 8:09:41 AM</span></div></footer> <!----> <div class="comments-wrapper"><!----></div> <ul class="side-bar sub-sidebar-wrapper" style="width:12rem;" data-v-70334359><li class="level-2" data-v-70334359><a href="/blogs/Java/jvm.html#认识jvm规范" class="sidebar-link reco-side-认识jvm规范" data-v-70334359>认识JVM规范</a></li><li class="level-3" data-v-70334359><a href="/blogs/Java/jvm.html#_2-1-从三种认知角度重识jvm" class="sidebar-link reco-side-_2-1-从三种认知角度重识jvm" data-v-70334359>2-1 从三种认知角度重识JVM</a></li><li class="level-3" data-v-70334359><a href="/blogs/Java/jvm.html#_2-2-jvm规范作用及其核心" class="sidebar-link reco-side-_2-2-jvm规范作用及其核心" data-v-70334359>2-2 JVM规范作用及其核心</a></li><li class="level-3" data-v-70334359><a href="/blogs/Java/jvm.html#_2-3-理解jvm规范中的虚拟机结构" class="sidebar-link reco-side-_2-3-理解jvm规范中的虚拟机结构" data-v-70334359>2-3 理解JVM规范中的虚拟机结构</a></li><li class="level-3" data-v-70334359><a href="/blogs/Java/jvm.html#_2-4-如何学习jvm规范中的指令集" class="sidebar-link reco-side-_2-4-如何学习jvm规范中的指令集" data-v-70334359>2-4 如何学习JVM规范中的指令集</a></li><li class="level-3" data-v-70334359><a href="/blogs/Java/jvm.html#_2-5-class字节码解析-理解classfile结构" class="sidebar-link reco-side-_2-5-class字节码解析-理解classfile结构" data-v-70334359>2-5 Class字节码解析：理解ClassFile结构</a></li><li class="level-3" data-v-70334359><a href="/blogs/Java/jvm.html#_2-6-阅读class字节码-常量池" class="sidebar-link reco-side-_2-6-阅读class字节码-常量池" data-v-70334359>2-6 阅读Class字节码：常量池</a></li><li class="level-3" data-v-70334359><a href="/blogs/Java/jvm.html#_2-7-阅读class字节码-类定义和属性" class="sidebar-link reco-side-_2-7-阅读class字节码-类定义和属性" data-v-70334359>2-7 阅读Class字节码：类定义和属性</a></li><li class="level-3" data-v-70334359><a href="/blogs/Java/jvm.html#_2-8-阅读class字节码-方法和方法调用" class="sidebar-link reco-side-_2-8-阅读class字节码-方法和方法调用" data-v-70334359>2-8 阅读Class字节码：方法和方法调用</a></li><li class="level-3" data-v-70334359><a href="/blogs/Java/jvm.html#_2-9-asm开发-编程模型和核心api" class="sidebar-link reco-side-_2-9-asm开发-编程模型和核心api" data-v-70334359>2-9 ASM开发：编程模型和核心API</a></li><li class="level-3" data-v-70334359><a href="/blogs/Java/jvm.html#_2-10-asm开发-classvisitor开发" class="sidebar-link reco-side-_2-10-asm开发-classvisitor开发" data-v-70334359>2-10 ASM开发：ClassVisitor开发</a></li><li class="level-3" data-v-70334359><a href="/blogs/Java/jvm.html#_2-11-asm开发-methodvisitor开发" class="sidebar-link reco-side-_2-11-asm开发-methodvisitor开发" data-v-70334359>2-11 ASM开发：MethodVisitor开发</a></li><li class="level-3" data-v-70334359><a href="/blogs/Java/jvm.html#_2-12-asm开发-实现模拟aop功能" class="sidebar-link reco-side-_2-12-asm开发-实现模拟aop功能" data-v-70334359>2-12 ASM开发：实现模拟AOP功能</a></li><li class="level-2" data-v-70334359><a href="/blogs/Java/jvm.html#类加载、连接和初始化" class="sidebar-link reco-side-类加载、连接和初始化" data-v-70334359>类加载、连接和初始化</a></li><li class="level-2" data-v-70334359><a href="/blogs/Java/jvm.html#内存分配" class="sidebar-link reco-side-内存分配" data-v-70334359>内存分配</a></li><li class="level-2" data-v-70334359><a href="/blogs/Java/jvm.html#字节码执行引擎" class="sidebar-link reco-side-字节码执行引擎" data-v-70334359>字节码执行引擎</a></li><li class="level-2" data-v-70334359><a href="/blogs/Java/jvm.html#垃圾回收" class="sidebar-link reco-side-垃圾回收" data-v-70334359>垃圾回收</a></li><li class="level-2" data-v-70334359><a href="/blogs/Java/jvm.html#高效并发" class="sidebar-link reco-side-高效并发" data-v-70334359>高效并发</a></li><li class="level-2" data-v-70334359><a href="/blogs/Java/jvm.html#性能监控与故障处理工具" class="sidebar-link reco-side-性能监控与故障处理工具" data-v-70334359>性能监控与故障处理工具</a></li><li class="level-2" data-v-70334359><a href="/blogs/Java/jvm.html#【实战】jvm调优" class="sidebar-link reco-side-【实战】jvm调优" data-v-70334359>【实战】JVM调优</a></li><li class="level-2" data-v-70334359><a href="/blogs/Java/jvm.html#面试加油站" class="sidebar-link reco-side-面试加油站" data-v-70334359>面试加油站</a></li><li class="level-2" data-v-70334359><a href="/blogs/Java/jvm.html#课程总结" class="sidebar-link reco-side-课程总结" data-v-70334359>课程总结</a></li></ul></main> <!----></div></div></div></div><div class="global-ui"><div class="back-to-ceiling" style="right:1rem;bottom:6rem;width:2.5rem;height:2.5rem;border-radius:.25rem;line-height:2.5rem;display:none;" data-v-c6073ba8 data-v-c6073ba8><svg t="1574745035067" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5404" class="icon" data-v-c6073ba8><path d="M526.60727968 10.90185116a27.675 27.675 0 0 0-29.21455937 0c-131.36607665 82.28402758-218.69155461 228.01873535-218.69155402 394.07834331a462.20625001 462.20625001 0 0 0 5.36959153 69.94390903c1.00431239 6.55289093-0.34802892 13.13561351-3.76865779 18.80351572-32.63518765 54.11355614-51.75690182 118.55860487-51.7569018 187.94566865a371.06718723 371.06718723 0 0 0 11.50484808 91.98906777c6.53300375 25.50556257 41.68394495 28.14064038 52.69160883 4.22606766 17.37162448-37.73630017 42.14135425-72.50938081 72.80769204-103.21549295 2.18761121 3.04276886 4.15646224 6.24463696 6.40373557 9.22774369a1871.4375 1871.4375 0 0 0 140.04691725 5.34970492 1866.36093723 1866.36093723 0 0 0 140.04691723-5.34970492c2.24727335-2.98310674 4.21612437-6.18497483 6.3937923-9.2178004 30.66633723 30.70611158 55.4360664 65.4791928 72.80769147 103.21549355 11.00766384 23.91457269 46.15860503 21.27949489 52.69160879-4.22606768a371.15156223 371.15156223 0 0 0 11.514792-91.99901164c0-69.36717486-19.13165746-133.82216804-51.75690182-187.92578088-3.42062944-5.66790279-4.76302748-12.26056868-3.76865837-18.80351632a462.20625001 462.20625001 0 0 0 5.36959269-69.943909c-0.00994388-166.08943902-87.32547796-311.81420293-218.6915546-394.09823051zM605.93803103 357.87693858a93.93749974 93.93749974 0 1 1-187.89594924 6.1e-7 93.93749974 93.93749974 0 0 1 187.89594924-6.1e-7z" p-id="5405" data-v-c6073ba8></path><path d="M429.50777625 765.63860547C429.50777625 803.39355007 466.44236686 1000.39046097 512.00932183 1000.39046097c45.56695499 0 82.4922232-197.00623328 82.5015456-234.7518555 0-37.75494459-36.9345906-68.35043303-82.4922232-68.34111062-45.57627738-0.00932239-82.52019037 30.59548842-82.51086798 68.34111062z" p-id="5406" data-v-c6073ba8></path></svg></div><div class="reco-bgm-panel" data-v-b1d3339e><audio id="bgm" src="/music/1.m4a" data-v-b1d3339e></audio> <div class="reco-float-box" style="bottom:200px;z-index:999999;display:none;" data-v-b1d3339e data-v-41bcba48 data-v-b1d3339e><img src="https://y.qq.com/music/photo_new/T002R300x300M0000046Etze42qCxC_1.jpg" data-v-b1d3339e></div> <div class="reco-bgm-box" style="left:10px;bottom:10px;z-index:999999;" data-v-b1d3339e data-v-41bcba48 data-v-b1d3339e><div class="reco-bgm-cover" style="background-image:url(https://y.qq.com/music/photo_new/T002R300x300M0000046Etze42qCxC_1.jpg);" data-v-b1d3339e><div class="mini-operation" style="display:none;" data-v-b1d3339e><i class="reco-bgm reco-bgm-pause" style="display:none;" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-play" style="display:none;" data-v-b1d3339e></i></div> <div class="falut-message" style="display:none;" data-v-b1d3339e>
          播放失败
        </div></div> <div class="reco-bgm-info" data-v-b1d3339e data-v-41bcba48 data-v-b1d3339e><div class="info-box" data-v-b1d3339e><i class="reco-bgm reco-bgm-music music" data-v-b1d3339e></i>苍穹</div> <div class="info-box" data-v-b1d3339e><i class="reco-bgm reco-bgm-artist" data-v-b1d3339e></i>韩磊</div> <div class="reco-bgm-progress" data-v-b1d3339e><div class="progress-bar" data-v-b1d3339e><div class="bar" data-v-b1d3339e></div></div></div> <div class="reco-bgm-operation" data-v-b1d3339e><i class="reco-bgm reco-bgm-last last" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-pause pause" style="display:none;" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-play play" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-next next" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-volume1 volume" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-mute mute" style="display:none;" data-v-b1d3339e></i> <div class="volume-bar" data-v-b1d3339e><div class="bar" data-v-b1d3339e></div></div></div></div> <div class="reco-bgm-left-box" data-v-b1d3339e data-v-41bcba48 data-v-b1d3339e><i class="reco-bgm reco-bgm-left" data-v-b1d3339e></i></div></div></div><!----></div></div>
    <script src="/assets/js/app.b9ccfc55.js" defer></script><script src="/assets/js/4.8390fbcb.js" defer></script><script src="/assets/js/1.3334f995.js" defer></script><script src="/assets/js/23.d3455a59.js" defer></script>
  </body>
</html>
